var express = require('express');
var router = express.Router();
var sign =require('./sign.js');


exports.getproductlist = function(req,res){
   var data=sign.delEmptyValue(req.body);
    sign.dataReq(req,data,req.session.apikey,'/sysmanage/product/getproductlist',"POST",function(ResData){
        if(ResData!=""){
            res.json(ResData);
        }
    });
}


exports.edit = function(req,res){
    sign.dataReq(req,req.body,req.session.apikey,'/sysmanage/product/editProduct',"POST",function(ResData){
        if(ResData!=""){
         res.json(ResData);
       
        }
    });
}

exports.getcommunicationprotocollist = function(req,res){
    sign.nullDataReq(req,req.session.apikey,'/sysmanage/product/getcommunicationprotocollist',"POST",function(ResData){
        if(ResData!=""){
         res.json(JSON.parse(ResData));
        }
    });
}
exports.getProduct = function(req,res){
    sign.dataReq(req,req.body,req.session.apikey,'/sysmanage/product/getProduct',"POST",function(ResData){
        if(ResData!=""){
         res.json(ResData);
        }
    });
}

exports.del= function(req,res){
    sign.dataReq(req,{'ids':[req.body.id]},req.session.apikey,'/sysmanage/product/delProduct','post',function(ResData){
        if(ResData!=''){
            res.send(ResData);
        }
    })

}

